This test was failing for he wrong reason. Calls to block-attach after the
authordan@guaranine.beaverton.ibm.com <dan@guaranine.beaverton.ibm.com>
Sat, 12 Nov 2005 17:25:12 +0000 (18:25 +0100)
committerdan@guaranine.beaverton.ibm.com <dan@guaranine.beaverton.ibm.com>
Sat, 12 Nov 2005 17:25:12 +0000 (18:25 +0100)
first *should* report failure, so the test should not fail because of this.
The test now fails because multiple calls to block-attach seem to detach the
block devicem, which is wrong.

Signed-off-by: Dan Smith <danms@us.ibm.com>
tools/xm-test/tests/block-create/04_block_attach_device_repeatedly_pos.py

index 7d56509bee4da047b5524020e714410a5c242f8b..63a79965af1258acace876ca6cf4e022f7a5856c 100644 (file)
@@ -38,11 +38,13 @@ except ConsoleError, e:
     
 for i in range(10):
        status, output = traceCommand("xm block-attach %s phy:ram1 sdb1 w" % domain.getName())
-       if status != 0:
-               FAIL("xm block-attach returned invalid %i != 0" % status)
+        if i == 0 and status != 0:
+            FAIL("xm block attach returned invalid %i != 0" % status)
+       if i > 0 and status == 0:
+            FAIL("xm block-attach (repeat) returned invalid %i > 0" % status)
        run = console.runCmd("cat /proc/partitions")
        if not re.search("sdb1", run['output']):
-               FAIL("Device is not actually attached to domU")
+            FAIL("Device is not actually attached to domU")
 
 # Close the console
 console.closeConsole()